Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Genesis upgrade and add invariant cherry pick #1081

Merged
merged 10 commits into from
Mar 13, 2022

Conversation

antstalepresh
Copy link
Contributor

Closes: #XXX

Description


For contributor use:

  • Targeted PR against correct branch (see CONTRIBUTING.md)
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/)
  • Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer

@codecov-commenter
Copy link

codecov-commenter commented Mar 13, 2022

Codecov Report

Merging #1081 (6a7458a) into main (f897502) will increase coverage by 0.11%.
The diff coverage is 60.41%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1081      +/-   ##
==========================================
+ Coverage   20.64%   20.75%   +0.11%     
==========================================
  Files         193      194       +1     
  Lines       25270    25318      +48     
==========================================
+ Hits         5218     5256      +38     
- Misses      19096    19102       +6     
- Partials      956      960       +4     
Impacted Files Coverage Δ
x/claim/keeper/hooks.go 28.00% <ø> (ø)
x/superfluid/keeper/hooks.go 66.66% <33.33%> (-5.56%) ⬇️
x/superfluid/keeper/invariants.go 54.05% <54.05%> (ø)
x/superfluid/keeper/intermediary_account.go 88.15% <100.00%> (+1.39%) ⬆️
x/superfluid/keeper/stake.go 58.13% <0.00%> (+4.65%) ⬆️
x/superfluid/keeper/keeper.go 100.00% <0.00%> (+6.25%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f897502...6a7458a. Read the comment docs.

Comment on lines +91 to +96
func (h Hooks) AfterValidatorSlashed(ctx sdk.Context, valAddr sdk.ValAddress, infractionHeight int64, slashFactor sdk.Dec, effectiveSlashFactor sdk.Dec) {
if slashFactor.IsZero() {
return
}
h.k.RefreshIntermediaryDelegationAmounts(ctx)
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't backport this PR due to this change. We do need to get the export genesis changes onto v7.x though. Eugen can you make a PR to v7.x with the import / export genesis changes?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually I'll just have the bot open that PR, and we just comment out these lines

Comment on lines +27 to +50
// {
// "with single validator and multiple superfluid delegations",
// []stakingtypes.BondStatus{stakingtypes.Bonded},
// 2,
// []superfluidDelegation{{0, 0, 0, 1000000}, {1, 0, 0, 1000000}},
// []int64{0},
// []int64{0, 1},
// },
// {
// "with multiple validators and multiple superfluid delegations with single validator slash",
// []stakingtypes.BondStatus{stakingtypes.Bonded, stakingtypes.Bonded},
// 2,
// []superfluidDelegation{{0, 0, 0, 1000000}, {1, 1, 0, 1000000}},
// []int64{0},
// []int64{0},
// },
// {
// "with multiple validators and multiple superfluid delegations with two validators slash",
// []stakingtypes.BondStatus{stakingtypes.Bonded, stakingtypes.Bonded},
// 2,
// []superfluidDelegation{{0, 0, 0, 1000000}, {1, 1, 0, 1000000}},
// []int64{0, 1},
// []int64{0, 1},
// },
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll need to fix these tests in an upcoming PR

@ValarDragon ValarDragon merged commit a454116 into main Mar 13, 2022
@ValarDragon ValarDragon deleted the genesis_upgrade_and_add_invariant_cherry_pick branch March 13, 2022 17:53
@ValarDragon ValarDragon added the A:backport/v7.x Do not use. backport patches to v7.x branch label Mar 13, 2022
mergify bot pushed a commit that referenced this pull request Mar 13, 2022
* add TotalSuperfluidDelegationInvariant

* update invariant name

* Update x/superfluid/keeper/invariants.go

Co-authored-by: Dev Ojha <[email protected]>

* Update x/superfluid/keeper/invariants.go

Co-authored-by: Dev Ojha <[email protected]>

* revert back changes for SetLockIdIntermediaryAccountConnection

* convert to round

* add invariant checker function call on all superfluid tests

* update go mod/sum

* add after validator slashed hook

* following updates for main branch cherry-pick

Co-authored-by: Dev Ojha <[email protected]>
(cherry picked from commit a454116)

# Conflicts:
#	go.sum
#	x/superfluid/keeper/slash_test.go
ValarDragon pushed a commit that referenced this pull request Mar 15, 2022
* Genesis upgrade and add invariant cherry pick (#1081)

* add TotalSuperfluidDelegationInvariant

* update invariant name

* Update x/superfluid/keeper/invariants.go

Co-authored-by: Dev Ojha <[email protected]>

* Update x/superfluid/keeper/invariants.go

Co-authored-by: Dev Ojha <[email protected]>

* revert back changes for SetLockIdIntermediaryAccountConnection

* convert to round

* add invariant checker function call on all superfluid tests

* update go mod/sum

* add after validator slashed hook

* following updates for main branch cherry-pick

Co-authored-by: Dev Ojha <[email protected]>
(cherry picked from commit a454116)

# Conflicts:
#	go.sum
#	x/superfluid/keeper/slash_test.go

* resolve conflicts

Co-authored-by: antstalepresh <[email protected]>
Co-authored-by: antstalepresh <[email protected]>
@github-actions github-actions bot mentioned this pull request Jan 15, 2024
@github-actions github-actions bot mentioned this pull request Feb 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A:backport/v7.x Do not use. backport patches to v7.x branch
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants